package net.ib.mtalk.network.task;

import android.content.Context;
import android.os.Handler;
import net.ib.mntalk.protocol.Common.SuggestionTarget;
import net.ib.mntalk.protocol.Common.UUIDMsg;
import net.ib.mntalk.protocol.Session.PostponeSuggestionsReq;
import net.ib.mtalk.network.MethodId.Session;
import net.ib.mtalk.network.TcpEnvelope;
import net.ib.mtalk.util.GpbSupport;
import net.ib.mtalk.util.NotifyingAsyncQueryHandler;

public class PostponeSuggestionsTask extends AsyncNetTask {
	
	private Context mContext;
	private Handler mUiHandler;
	private NotifyingAsyncQueryHandler mDbHandler;
	private int type;

	public PostponeSuggestionsTask(Context _context, Handler _uiHandler, int _type) {
		super(_context, _uiHandler);
		mContext = _context;
		mUiHandler = _uiHandler;
		this.type = _type;
	}

	@Override
	protected TcpEnvelope onPreExecute() {
		PostponeSuggestionsReq postponeSuggestionsReq = new PostponeSuggestionsReq();
//		postponeSuggestionsReq.setUserUuid(GpbSupport.makeUuidMsg(333, 444));
		
		SuggestionTarget suggestionTarget = new SuggestionTarget();
		suggestionTarget.setObjectUuid(GpbSupport.makeUuidMsg(333, 444));
		suggestionTarget.setType(type);
		int index = 0;
		postponeSuggestionsReq.setTarget(index, suggestionTarget);
		
		TcpEnvelope rev = new TcpEnvelope.Builder()
			.setType(TcpEnvelope.REQUEST)
			.setMessage(postponeSuggestionsReq)
			.setMethodId(Session.Suggestion.PostponeSuggestions)
			.build();
		return rev;
	}

	@Override
	protected void onPostExecute(int resultCode, Object requestObj,
			Object resultObj) {
		// TODO Auto-generated method stub

	}

}
